1. Technical Field
The present invention relates to an electronic device that establishes communication with an external device such as a personal computer (PC) and receives a supply of power from the external device.
2. Related Art
For example, JP-A-2012-203765 discloses a mobile telephone as an example of an electronic device which charges a battery (a rechargeable cell) using a supply of power from a host device when a USB terminal portion is connected to the host device (an example of the external device). The mobile telephone starts an initialization process (enumeration) by performing data transfer between the mobile telephone and the host device via the USB terminal portion, and performs charging of the battery using a first power (for example, a 100 mA current). When the initialization process completes within a predetermined time after the USB terminal portion is connected to the host device, a process is performed based on the initialization process. Meanwhile, when the initialization process does not complete within a predetermined time after the USB terminal portion is connected to the host device, the mobile telephone performs the charging of the battery using a second power (for example, a 500 mA current) which is greater than the first power.
When the initialization process does not complete within the predetermined time, the charging of the battery uses the second power which is greater than the first power. In this case, the host device supplies the second power by artificially removing the connection between the mobile telephone and the host device by setting the potential of a D+ terminal and the potential of a D− terminal to the same potential by causing the electronic device to perform a pull-down.
When the USB terminal portion is connected to a power adapter (an example of a first type device) such as a USB battery charger, the electronic device (the mobile telephone) charges the battery using the power that is supplied from the power adapter.
Incidentally, when the electronic device and the host device perform the charging when a USB connection is realized, a CPU (which configures a control circuit) transmits a request for the second power which is greater than the first power, and also transmits configuration information, which is referred to as a descriptor, including class information (a printer class, for example) to the host device in the initialization process (the enumeration). The host device recognizes which type of device (a printer, for example) the electronic device is based on the class information, and that the electronic device is capable of supplying the second power. The host device then transmits an initialization process completion notification to the electronic device to notify the electronic device of the settings of the configuration information. The electronic device can be charged by receiving the supply of the second power from the host device after the initialization process completion notification is received and the initialization process is completed.
There is a case in which the host device may not be capable of the supply of power using the second power that is requested by the electronic device. An example of this case is when the host device and the electronic device are connected to each other via a hub which operated on bus power. In this case, even if the electronic device transmits the configuration information which includes the second power and the class information in the initialization process, the host device recognizes that the connection is made via a hub which is incapable of the supply of power using the second power, and thus the host device does not set the configuration information. Therefore, the initialization process completion notification (a setting complete notification) (which notifies the electronic device of the setting of the configuration) is not transmitted from the host device to the electronic device. As a result, the electronic device waits for the initialization process completion notification that will not be transmitted from the host device, and the CPU is left in an active state.
For example, there is a case in which the host device is set to only allow the supply of power using a third power of less than a maximum power supply (for example, a current of 500 mA) in order to suppress the consumption of power when the host device is battery driven. When a request is transmitted from the electronic device to this type of host device to request the second power which is greater than the third power, since the host device is not capable of the supplying the power using the second power, the initialization process completion notification is also not transmitted from the host device to the electronic device in this case. Therefore, the electronic device waits for the initialization process completion notification that will not be transmitted from the host device, and thus the CPU is also left in the active state in this case also.
First, description will be given of the problem when the electronic device is connected to the host device in a power-off state. Note that, the host device is assumed to be a second type device such as a PC. In this case, although the supply of power is performed from the host device through a communication cable using the first power (for example, a guaranteed 100 mA current) before the initialization process, the power which is consumed by the CPU of the electronic device is wasted. In particular, if the power that is consumed by the CPU of the electronic device in the state of waiting for the initialization process completion notification is greater than the first power, the remaining capacity of the cell is slowly reduced. There is a problem in that, when the host device is not capable of supplying the power to the electronic device using the second power, the remaining capacity of the cell is slowly reduced by the power consumption of the CPU (or the like) of the control circuit which is activated in a power-off state of the electronic device due to a cause such as one of the two cases that are exemplified above. In other words, there is a problem in that, when the control circuit of the electronic device which is connected to the external device and is activated in a power-off state fails to perform the initialization process with the external device, the electricity (the power) associated with activating the control circuit is wasted.
Next, description will be given of the problem when the electronic device is connected to the host device (a second type device) in a power-on state. In an electronic device described in JP-A-2012-203765, when the initialization process does not complete within the predetermined time after the USB terminal portion is connected to the host device due to a cause such as one of the two cases that are exemplified above, the electronic device can receive a supply of the second power from the host device by artificially removing the connection between the electronic device and the host device by setting the potential of a D+ terminal and the potential of a D− terminal to the same potential by performing a pull-down. However, there is a problem in that, due to the connection between the host device and the electronic device being artificially removed, the host device may not be capable of recognizing which type of device the connection partner (the electronic device) is after connection removal. When the host device is unable to recognize the electronic device, even if the user sends an instruction from the host device to the electronic device, the host device cannot determine whether or not the electronic device of the connection partner is a device for which the process based on the instruction may be performed, and thus cannot cause the electronic device to perform the instructed process. When the electronic device is, for example, a printer, even if the user performs a print instruction from the host device, since the host device does not recognize the electronic device as a printer, the generation and transmission of print data is not performed, and it is not possible to cause the printer to perform the instructed printing. When the electronic device described in JP-A-2012-203765 cannot complete the initialization process with the external device, fails, and cannot establish communication with the external device, while it is possible to receive the supply of the second power, since the external device does not recognize the electronic device, there is a problem in that the electronic device cannot perform a process which the external device should have been capable of instructing if the external device had recognized the electronic device. In this manner, when the electronic device is in the on state, there is a case in which it is necessary to prioritize the establishment of communication between the electronic device and the external device over receiving a supply of the second power from the external device. In other words, there is a problem in that, when the electronic device which is connected to the external device in the power-on state fails to perform the initialization process including the request for power, it is difficult to establish communication with the external device.
In the electronic device described in JP-A-2012-203765, there is a case in which the host device and the electronic device are reconnected with each other in a state in which the connection between the host device and the electronic device is continued. Examples of such a case include 1) a case in which the cell is fully charged with the power off, communication cuts out, the remaining capacity of the cell subsequently falls below a threshold due to discharging, charging becomes necessary again, and reconnection is performed, and 2) a case in which a power adapter is connected during USB charging, communication is disconnected in order to stop the USB charging, the power adapter is subsequently removed, and reconnection is performed in order to start the USB charging again. A case in which reconnection is performed by switching the power between on and off in a state in which the connection between the host device and the electronic device is continued. When the electronic device is a printer, for example, during the switching of the power between on and off, the host device and the electronic device are reconnected in order to perform the initialization process which switches the class of the device to be recognized by the host device from the power-off time class (for example, a HID class), to a power-on time class (for example a printer class).
During reconnection, which is an example of the above cases, the initialization process between the host device and the electronic device is performed. However, in the electronic device described in JP-A-2012-203765, the initialization process which includes a request for the second power is performed for every reconnection. For example, even if the initialization process which is performed before the reconnection fails once without being able to complete within a predetermined time for some reason, the electronic device performs the initialization process which contains the request for the second power that is highly likely to fail in relation to the same host device for which the initialization process already failed once. As a result, the initialization process which has a high likelihood of failing is performed, a predetermined time has to be waited until the initialization process fails, and there is a problem in that electricity is wasted due to the control circuit executing this type of wasteful initialization process. In other words, when the reconnection (which involves the initialization process with the external device) is performed in the state in which the connection with the external device is continued, there is a problem that electricity (power) is wasted by the control circuit of the electronic device.
The problems described above are not limited to electronic devices such as mobile telephones and printers (including multi-function devices), and are generally shared by electronic devices such as scanners, projectors, digital cameras (imaging devices), and audio devices, which perform the initialization process with the host device when connected to the host device (the external device).